package com.example.testspringboot.mapper;

import com.example.testspringboot.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from hkd_user")
    @Results({
            @Result(property = "createBy", column = "create_by"),
            @Result(property = "createTime", column = "create_time")
    })
    List<User> getUserInfo();

    @Select("select * from hkd_user where id=#{id}")
    @Results({
            @Result(property = "createBy", column = "create_by"),
            @Result(property = "createTime", column = "create_time")
    })
    User queryUserId(@Param("id") String id);


    User findByName(@Param("name") String name);
}
